import { _decorator, Camera, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('worldChange')
export class worldChange extends Component {
    // 世界节点
    @property(Node)
    worldNode: Node = null;
    // 城市节点
    @property(Node)
    cityNode: Node = null;
    // 显示层
    @property(Node)
    topshow: Node = null;
    // 世界
    private world: Node = null;
    // 城市
    private city: Node = null;

    protected onLoad(): void {
        this.world = this.node.getChildByName('world');
        this.city = this.node.getChildByName('city');
    }

    worldChange() {
        console.log('世界');
        this.world.active = !this.world.active; // 
        this.city.active = !this.city.active;
        this.worldNode.active = !this.worldNode.active;
        this.cityNode.active = !this.cityNode.active;
        this.topshow.active = !this.topshow.active;
    }

    cityChange() {
        console.log('城市');
        this.city.active = !this.city.active;
        this.world.active = !this.world.active;
        this.worldNode.active = !this.worldNode.active;
        this.cityNode.active = !this.cityNode.active;
        this.topshow.active = !this.topshow.active;
    }
}


